package com.example.kemusan.mapper;

import com.example.kemusan.pojo.SystemuserInfo;
import com.example.kemusan.pojo.dto.NewPassword;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SystemuserInfoMapper {

    @Select("select username, password, type from systemuser_info where username = #{username} and password = #{password} and type = #{type}")
    public SystemuserInfo selectSystemuser(SystemuserInfo systemuserInfo);

    @Update("update systemuser_info set password = #{newPassword} where password = #{oldPassword} and username = #{username}")
    public Integer setNewPassword(NewPassword newPassword);
}
